Imports StructureMap
Imports StructureMap.Attributes
Imports StructureMap.Graph
Imports StructureMap.Configuration.StructureMapConfigurationSection
Imports StructureMap.Configuration.DSL
Imports myBookmarks.Data

Namespace myBookmarks.Web
    Public Class StructureMapControllerFactory
        Inherits DefaultControllerFactory
        Protected Overloads Overrides Function GetControllerInstance(ByVal controllerType As Type) As IController
            If controllerType Is Nothing Then
                Return MyBase.GetControllerInstance(controllerType)
            End If

            Dim result As IController = Nothing
            Try
                result = TryCast(ObjectFactory.GetInstance(controllerType), Controller)
            Catch generatedExceptionName As StructureMapException

                Throw
            End Try

            Return result
        End Function
    End Class
End Namespace
